﻿<div class="d-flex flex-column overflow-hidden h-100 w-100">
    <div id="@ViewportEleId" class="viewport xaf-flex-auto">
        <div class="entity-association-editor">
            @foreach (var entity in Entities)
            {
                <EntityNode @key="entity"
                            Entity="entity"
                            DomainModel="DomainModel"
                            EntityUpdater="EntityUpdater"
                            IsSelected="SelectedEntityIds.Contains(entity.Oid)"
                            DoubleClicked="()=>Model.RaiseEntityDoubleClicked(entity)" />
            }
        </div>
    </div>
    <DxTextBox CssClass="mt-2"
               InputId="@CommandLineEleId"
               BindValueMode="BindValueMode.OnDelayedInput"
               ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto">
        <Buttons>
            <DxButton Click="BatchCommand" RenderStyle="ButtonRenderStyle.None" RenderStyleMode="ButtonRenderStyleMode.Text">
                <XafImage ImageName="Actions_Arrow3Right" Size="16" Color="#666" />
            </DxButton>
        </Buttons>
    </DxTextBox>
</div>

@code {
    public static RenderFragment Create(EntityAssociationModel model)
    {
        return @<EntityAssociationRenderer Model="model" />;
    }
}